# Contributor: Maxim Karasev <begs@disroot.org>
# Maintainer: Maxim Karasev <begs@disroot.org>
pkgname=visurf
pkgver=0.0.0_git20220301
_commit=8f7036e440f47a37ec917b6856ba20cd747adceb
_netsurf=3.10
_libcss=f420dd16136de1dc07f18824c6d0f5540d5df6d1
pkgrel=0
pkgdesc="power-user frontend for netsurf with vi-inspired keybindings"
url="https://sr.ht/~sircmpwn/visurf/"
arch="all"
license="MIT GPL-2.0-only"
makedepends="
	flex bison gperf wayland-protocols expat-dev curl-dev wayland-dev
	cairo-dev pango-dev libxkbcommon-dev libjpeg-turbo-dev libwebp-dev
	openssl1.1-compat-dev libpng-dev perl
	"
options="!check" # no tests
source="
	https://git.sr.ht/~sircmpwn/visurf/archive/$_commit.tar.gz
	https://download.netsurf-browser.org/netsurf/releases/source-full/netsurf-all-$_netsurf.tar.gz
	http://git.netsurf-browser.org/libcss.git/snapshot/libcss-$_libcss.tar.gz
	"
builddir="$srcdir/netsurf-all-$_netsurf"

build() {
	rm -rf netsurf libcss
	mv "$srcdir"/visurf-$_commit netsurf
	mv "$srcdir"/libcss-$_libcss libcss
	make TARGET=visurf PREFIX=/usr LIBDIR=lib INCLUDEDIR=include
}

package() {
	make TARGET=visurf DESTDIR="$pkgdir" PREFIX=/usr install
	install -Dm755 netsurf/tools/urlfilter "$pkgdir"/usr/bin/urlfilter
}

sha512sums="
22f1b76449bc42c9be9705730f68cb5c4d642a17cbf04009d440b846403d872c361bf61d8e04c47c607576833232e62f9b2190f910df00276137e72044b831ea  8f7036e440f47a37ec917b6856ba20cd747adceb.tar.gz
fc4c300eef07c540a7e07f8034db25b7e5fb731b5956029af2220f8638802aa38c055ad54b5683c14501aef9c22fb781b96613c16ae9a6996c3833ceede6f9bf  netsurf-all-3.10.tar.gz
26d9f3ba1aa26540351466ca3f998a9b5e2c4cc8c38cb3201d24f3e3b72683bb12e2ae180ed503cd4a153e9f34c5caccb9218e70056ac2a0d1e1faeb68807929  libcss-f420dd16136de1dc07f18824c6d0f5540d5df6d1.tar.gz
"
